package com.huan;

/**
 * 线程轮询的五种方法
 * @author chenbin78
 * @version 1.0
 * @create_date 2021/4/19 10:03
 */
public class ThreadPolling {


    public static void main(String[] args) {

        //SynchronizedTest synchronizedTest = new SynchronizedTest();
        //SynchronizedBlock synchronizedBlock = new SynchronizedBlock();
        //ReentrantLockCondition reentrantLockCondition = new ReentrantLockCondition();
        //UnsafeCasTest unsafeCasTest = new UnsafeCasTest();
        AtomicIntegerTest atomicIntegerTest = new AtomicIntegerTest();

        //put线程
        new Thread("put") {
            @Override
            public void run() {
                atomicIntegerTest.put();
            }
        }.start();

        //get线程
        new Thread("get") {
            @Override
            public void run() {
                atomicIntegerTest.get();
            }
        }.start();
    }
}
